#!perl.exe

#*******************************************************}
#                                                       }
#       Yalgol/02 Compiler, Version 0.02 beta           }
#       Written by Y [17-10-00] <yallie@mail.ru>        }
#                                                       }
#       Perl script to increment build number           }
#                                                       }
#       Copyright (c) 1999-2003 YALLIE, Inc.            }
#       All Rights Reserved.                            }
#                                                       }
#*******************************************************}

# $Id: cbuild.pl,v 1.3 2003/01/28 14:29:03 Y Exp $

$InputFile = "build";
$OutputFile = "cbuild.y02";

open(InFile, $InputFile) || die("Can't open file \"$InputFile\""); 
$_ = <InFile>;
$BuildNumber = $_ + 1;
close(InFile);

open(OutFile, ">$OutputFile") || die("Can't create file \"$OutputFile\"");

# output source header
print OutFile "
/*******************************************************}
{                                                       }
{       Yalgol/02 Compiler, Version 0.02 beta           }
{       Generated by cbuild.pl, do not modify           }
{                                                       }
{       Build number                                    }
{                                                       }
{       Copyright (c) 1999-2003 YALLIE, Inc.            }
{       All Rights Reserved.                            }
{                                                       }
{*******************************************************/

// \$Id\$

const
  cBuildString = ";

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$BuildString = sprintf("%d (%04d/%02d/%02d %02d:%02d:%02d)", $BuildNumber,
  $year + 1900, $mon + 1, $mday, $hour, $min, $sec);
print OutFile "\"$BuildString\"

/*
  \$Log\$
  Revision 0.1  2002/08/21 23:06:14  Y
    * Yalgol/02 port

  Revision 0.0  2002/04/13 13:04:36  Y
    + wrote script and template (based on cstrings.pl)
    * see cbuild.pl for more log items
*/
";
close(OutFile);

open(OutFile, ">$InputFile");
print OutFile $BuildNumber;
close(OutFile);

# $Log: cbuild.pl,v $
# Revision 1.3  2003/01/28 14:29:03  Y
#   * updated copyright
#
# Revision 1.2  2002/09/12 21:38:05  Y
#   + changelog in cbuild.y02
#
# Revision 1.1  2002/09/12 20:55:24  Y
#   * imported into CVS
#
